package engine.graphics.shader
{
	import com.adobe.utils.*;
	import flash.display3D.*;
	
	public class RxFragmentShader extends RxShaderBase
	{
		public function RxFragmentShader()
		{
		}
		
		override public function Compile(param1:String, param2:Boolean = false) : Boolean
		{
			var _loc_6:int = 0;
			var _loc_7:String = null;
			m_constDefs = new RxShaderConstDefs();
			param1 = m_constDefs.ParseAsm(param1);
			var _loc_3:* = new AGALMiniAssembler();
			m_microcode = _loc_3.assemble(Context3DProgramType.FRAGMENT, param1, param2);
			var _loc_4:* = param1.match(/(v[0-7])""(v[0-7])/gs);
			var _loc_5:* = param1.match(/(fs[0-7])""(fs[0-7])/gs);
			if (_loc_4 != null)
			{
				_loc_6 = 0;
				while (_loc_6 < _loc_4.length)
				{
					
					_loc_7 = String(_loc_4[_loc_6]).charAt(1);
					m_regUsage = m_regUsage | REG_VARYING0 << uint(_loc_7);
					_loc_6++;
				}
			}
			if (_loc_5 != null)
			{
				_loc_6 = 0;
				while (_loc_6 < _loc_5.length)
				{
					
					_loc_7 = String(_loc_5[_loc_6]).charAt(2);
					m_regUsage = m_regUsage | REG_SAMPLER0 << uint(_loc_7);
					_loc_6++;
				}
			}
			return m_microcode != null;
		}
	}
}